<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>
<div class="span2" id="sidebar">
    <ul class="nav nav-list bs-docs-sidenav nav-collapse collapse">
        <c:forEach var="item" items="${sessionScope.USER_MENU.getPrivilegeList(type)}">
            <li <c:if test="${item.id==itemId}"> class="active" </c:if>>
                <a href="${BasePath}${item.link }?type=${item.categoryId }&itemId=${item.id}"><i
                        class="icon-chevron-right"></i>${item.name}</a>
            </li>
        </c:forEach>
    </ul>
</div>


<!-- 导航条
================================================== -->
<div class="navbar navbar-inverse navbar-fixed-top">
    <div class="navbar-inner">
        <!-- a class="brand" title="" href="${BasePath}/"><img
                height="45" src="${BasePath}/Public/Home/images/top_logo.jpg " title=""/></a -->
        <div class="top_nav">
            <ul class="nav" style="margin-right:0">
                <li class="dropdown admin_nav">
                    <a href="#" class="dropdown-toggle login-nav" data-toggle="dropdown" style="">${CURRENT_LOGIN_USER.name } <b
                            class="pl_5 fa fa-sort-down"></b></a>
                    <ul class="dropdown-menu" style="display:none">
                        <li><a href="${BasePath}/base/user/toUpdatePass?type=1&itemId=2">修改密码</a></li>
                        <li><a href="javascript:loginout()">退出</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</div>
<!-- /头部 -->

<script type="text/javascript">
    function loginout(){
        $.ajax({
            type:"POST",
            url:"${BasePath }/logout",
            datatype: "json",
            success:function(data){
                if(data.errno==0){
                    alert("退出成功！");
                    window.location.href="${BasePath}/login.html";
                }
            } ,
            error: function(){
                alert("操作出错，请联系管理员！");
            }
        });
    }

</script>
<!-- 主体 -->
<div id="main-container" class="container">
    <div class="sidebar">
        <ul class="sidenav">
            <c:forEach var="obj" items="${sessionScope.USER_MENU.categoryList }">
                <li>
                    <a class="sidenav_parent <c:if test="${obj.id==type}">isopen</c:if>" href="javascript:;"><b class="ficon fa fa-plus-square"></b>${obj.name}</a>
                    <ul class="sidenav_sub" style="<c:if test="${obj.id!=type}">display:none</c:if>">
                        <c:forEach var="item" items="${sessionScope.USER_MENU.getPrivilegeList(obj.id)}">
                        <li class="<c:if test="${item.id==itemId}">active</c:if>">
                            <a href="${BasePath}${item.link }?type=${item.categoryId }&itemId=${item.id}">${item.name}</a>
                            <b class="active_arrow"></b>
                        </li>
                        </c:forEach>
                    </ul>
                </li>
            </c:forEach>
        </ul>
    </div>
</div>